package com.xx;

import com.xx.entity.User;
import com.xx.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 许欣
 * 时间：2022/4/27 8:40
 * 描述：
 */
public class UserServiceTest {
    @Test
    public void getA(){
//        ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext01.xml");
//        UserService dao=context.getBean("userService",UserService.class);
////        User ret=dao.getByAccount("admin");
//        System.out.println(ret);

        ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext01.xml");
        UserService dao=context.getBean("userService",UserService.class);
       User ret=dao.getByAccount("lsi");
        System.out.println(ret);
//        User user=new User();
//        user.setAccount("lsi");
//        user.setPassword("123456");
//        user.setNick_name("张三");
//        user.setGender(2);
//        user.setId_card_no("136479657354862477");
//        user.setEmail("12854@56.com");
//        user.setPhone("18578085559");
//        user.setId(108);
//       int ret=dao.add(user);
//       if (ret>0){
//           System.out.println("成功");
//       }else {
//           System.out.println("失败");
//       }
    }
}
